using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace nBodyPhone
{
    class Timer
    {
        double lastTime;
        double currTime;
        double deltaTime;
        double fps;

        public Timer()
        {
            double lastTime = 0.0;
            double currTime = 0.0;
            double deltaTime = 0.0;
            double fps = 0.0;
        }

        public void update(GameTime gameTime)
        {
            currTime = gameTime.TotalGameTime.TotalMilliseconds;
            deltaTime = currTime - lastTime;
            lastTime = currTime;
            fps = 1.0 / (0.001 * deltaTime);
        }
        public double getFps()
        {
            return fps;
        }
    }
}
